package cn.mrlong.aavdemo;

import android.content.Intent;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import cn.mrlong.aavdemo.audiorecord.AudioRecordActivity;
import cn.mrlong.aavdemo.costom.CustomViewActivity;
import cn.mrlong.aavdemo.opengl.OpenGLES20Activity;
import cn.mrlong.aavdemo.surfaceview.SurfaceCameraActivity;
import cn.mrlong.aavdemo.textureview.TextureViewCameraActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.image)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        ImageViewActivity.class));
                    }
                });
        findViewById(R.id.surface)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        SurfaceViewActivity.class));
                    }
                });
        findViewById(R.id.costomView)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        CustomViewActivity.class));
                    }
                });
        findViewById(R.id.audioRecord)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        AudioRecordActivity.class));
                    }
                });
        findViewById(R.id.surfaceCamera)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        SurfaceCameraActivity.class));
                    }
                });
        findViewById(R.id.TextureViewCamera)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        TextureViewCameraActivity.class));
                    }
                });
        findViewById(R.id.OpenGL1)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MainActivity.this.startActivity(
                                new Intent(MainActivity.this,
                                        OpenGLES20Activity.class));
                    }
                });
    }
}